;(function () {

    window.onload = function () {
        $("#nav_vm_list").addClass("active");
    };
})();

// 归档虚拟机恢复
function vm_archive_recover(vm_uuid, xml_flag, vm_archid) {

    if (!confirm(gettext('确定要恢复此归档虚拟机？')))
            return;

    $.ajax({
        url: '/vms/recover?uuid='+vm_uuid + '&xml=' + xml_flag + '&vm_archid=' + vm_archid ,
        type: 'post',
        success: function (data, status_text) {
            alert(gettext('归档虚拟机成功恢复'));
            window.location = '/vms/';
        },
        error: function (xhr, msg, err) {
            // msg = get_err_msg_or_default(xhr, err);
            alert(xhr.responseJSON.msg);
        },
    });
}
